<%@taglib uri="/struts-tags" prefix = "s" %>
<%@ page language="java" import="java.sql.*,java.util.*"
	pageEncoding="utf-8"%>
	<%
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String item_id = request.getParameter("item_id");
 %>
<!DOCTYPE html>
<html lang="en">
<head>
 <link rel="stylesheet" type="text/css" href="<%=basePath %>/css/detail.css" />
	<meta charset="UTF-8">
	<title>Document</title>
	<script>
	function test(t){
		var t1 = document.getElementById("message_content");
// 		alert("成功2");
		console.log(t1);
		if(t!=null)
		t1.innerHTML = "对" + t + "说";
		else
		t1.innerHTML = "";
		t1.selectionEnd = 1;
		moveEnd(t1);
	}

	function moveEnd(obj){ 
		obj.focus(); 
		var len = obj.value.length; 
		if (document.selection) { 
			var sel = obj.createTextRange(); 
			sel.moveStart('character',len); 
			sel.collapse(); 
			sel.select(); 
		} else if (typeof obj.selectionStart == 'number' && typeof obj.selectionEnd == 'number') { 
			obj.selectionStart = obj.selectionEnd = len; 
		} 
	} 
	</script>
	
   
</head>
<body>
	
<div class="comment_container">
    <h3>我要留言(限255字)</h3>
    <form action="insert_topic?item_id=<%=item_id%>" method="post">
    <div class="align_center comment_area">
        <textarea id="message_content" name="message_content" maxlength="255" class="ubm_textinput" onclick="test()"></textarea>
        <input type="hidden" id="reply_to" value="0">
    </div>
    <div class="align_right dashed_border_bottom" style="padding-bottom: 20px;">
        <div style="text-align: right;">
            <input id="submit_message_button" class="button" style="width: 100px;"  name="yt0" type="submit" value="发布留言" />        </div>
    </div>
    </form>
    <div id="comment_list_view" class="list-view">
<div class="items">
 <s:iterator value="#request.topics" var="topic" > 
 
<div class="comment_item">
    <div class="user_pic">
        <a href="/user/3656769" target="_black">
            <img src="<%=path %><s:property value="#topic.post_user.ui.path"/>" title="赛亚人" alt="赛亚人">
        </a>
    </div>
    <div class="detail">
        <a class="name" href="/user/3656769" target="_blank"><s:property value="#topic.post_user.name"/></a>&nbsp;<span title="<s:if test='"#topic.post_user.sex=="male"'>男生</s:if><s:else>女生</s:else>" class="<s:property value="#topic.post_user.sex"/>"><s:if test="#topic.post_user.sex=='male'">
				 ♂
				</s:if>
				<s:else>
				♀
				</s:else></span>&nbsp;/&nbsp;<s:property value="#topic.post_user.school"/>       <p>
            <s:property value="#topic.content"/><br>        </p>
        <span class="time"><s:property value="#topic.post_time"/></span>
        <a class="comment_reply_link" href="#" onclick="test('<s:property value="#topic.post_user.name"/>')"  message_id="2008">回复</a>
            </div>
</div>
<div style="clear:both;"></div>
</s:iterator>
</div> <div class="keys" style="display:none" title="/comment/loadBookMsg?bookId=3342238&amp;type=sell"><span>2008</span><span>834</span><span>805</span><span>803</span><span>769</span><span>557</span></div>
</div>
</div>
</body>
</html>